﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Shop;
using log4net;
using Shop.Domain;
using Shop.Service;
using System.Globalization;
using System.Threading;
using Shop.Common;
using System.IO;
using System.Configuration;
using System.Data;
using PetaPoco;
using System.Text.RegularExpressions;
using System.Drawing; 

namespace Shop.Controllers
{

    [Localization]
    public class BaseController : Controller
    {
 
        //public UserInfo LoginUser { get; set; }
 

        public LogHelper log;
        public string _logoBaer64 = "";

        public BaseController()
        {
  
          
        }

        /// <summary>
        /// 执行控制器方法之前先执行该方法
        /// 获取自定义SessionId的值，然后从Memcache中取出
        /// </summary>
        /// <param name="filterContext"></param>
        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
         
            //if (!isExt) //用户没登录
            //{
            //    //filterContext.HttpContext.Response.Redirect("/Login/Index");
            //    filterContext.HttpContext.Response.Write("<script> top.document.location.href='/Login/Index'</script>");
            //    filterContext.HttpContext.Response.End();
            //}


            base.OnActionExecuting(filterContext);
        }
  
 


        #region 简繁拼音转换



        public string[] PaiLie(string[][] array)
        {
            int indesx = 1;
            for (int i = 0; i < array.Length; i++)
            {
                indesx = indesx * array[i].Length;
            }
            string[] sbtye = new string[indesx];
            int num = sbtye.Length;
            int num1 = 1;
            for (int i = 0; i < array.Length; i++)
            {
                if (array[i].Length<=0)
                {
                    continue;                    
                }
                num = num / array[i].Length;
                int yx = -1;
                for (int x = 0; x < num1; x++)
                {
                    for (int y = 0; y < array[i].Length; y++)
                    {
                        for (int z = 0; z < num; z++)
                        {
                            yx += 1;
                            sbtye[yx] += array[i][y].ToString();
                        }
                    }
                }
                num1 = num1 * array[i].Length;
            }
            return sbtye;
        }

        #endregion

    }
}
